let array = [[["c",["a"]],[["bc"],["cdef"]]]]
let result = []
function collection(arr){
for(let i = 0; i<arr.length; i++){
if(Array.isArray(arr[i])){
collection(arr[i]) //再次執行collection函式 所以會一直判斷是否為陣列
}
else{
result.push(arr[i])
}
}
return result
}
console.log(collection(array))